//
//  UIColor+add.h
//  GK
//
//  Created by Seven on 2018/12/19.
//  Copyright © 2018 Seven. All rights reserved.
//

#import <UIKit/UIKit.h>

#pragma mark- about color
/**
 颜色
 */
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define THEME_COLOR RGBCOLOR(47, 114, 213)
#define BACKGROUND_COLOR RGBCOLOR(235, 235, 235)

#define LINE_BACKGROUND_COLOR [UIColor colorWithHexString:LINE_COLOR]

#define HEADER_BACKGROUND_COLOR RGBCOLOR(255, 255, 255)
#define COLOR_SHADOW        [UIColor colorWithHex:0x9B9B9B]

#define COLOR_BLACK         [UIColor blackColor]
#define COLOR_BLACK_ALPHA   [UIColor colorWithWhite:0 alpha:0.75]
#define COLOR_WHITE         [UIColor whiteColor]
#define COLOR_CLEAR         [UIColor clearColor]
#define COLOR_999999        [UIColor colorWithHex:0x999999]
#define COLOR_666666        [UIColor colorWithHex:0x666666]
#define COLOR_3c3c3c        [UIColor colorWithHex:0x3c3c3c]
#define COLOR_333333        [UIColor colorWithHex:0x333333]
#define COLOR_DDDDDD        [UIColor colorWithHex:0xDDDDDD]
#define COLOR_BBBBBB        [UIColor colorWithHex:0xBBBBBB]
#define COLOR_TEXT_BLACK    [UIColor colorWithHex:0x484849]
#define COLOR_CUSTOM_TXT    [UIColor colorWithHex:0x272421]
#define COLOR_LIGHT_TXT     [UIColor colorWithHex:0x999999]
#define COLOR_CUSTOM_BLUE   [UIColor colorWithHex:0x189DF0]
#define COLOR_DARK_BLUE     [UIColor colorWithHex:0x233450]
#define COLOR_BLUE          [UIColor colorWithHex:0x008EFF]
#define COLOR_CUSTOM_RED    [UIColor colorWithHex:0xDB2F41]
#define COLOR_CUSTOM_YELLOW [UIColor colorWithHex:0xF4D23C]
#define COLOR_YELLOW        [UIColor colorWithHex:0xFFFF00]
#define COLOR_RED           [UIColor colorWithHex:0xDB2F41]
#define COLOR_BACKGROUND    ColorWithHex(0x212122)
#define COLOR_CUSTOM_ALPHA  [UIColor colorWithWhite:0 alpha:.8]
#define COLOR_CUSTOM_Y      [UIColor colorWithHex:0xffe633]
#define COLOR_GREEN         [UIColor colorWithHex:0x00BC67]

#define COLOR_CUSTOM_LINE   ColorWithHexAplha(0xF4F4F4, 1)

#define COLOR_NEW_KEYBOARD_YELLOW   [UIColor colorWithHex:0xFF8D00]
#define COLOR_NEW_KEYBOARD_GRAY     [UIColor colorWithHex:0xBCBEC3]

#define COLOR_BG_NAV                [UIColor colorWithHex: 0xfece00]
#define COLOR_BG_MAIN               [UIColor colorWithHex: 0xeeeeee]
#define COLOR_BG_PART               [UIColor colorWithHex: 0xffffff]
#define COLOR_TABBAR_SELECTED       [UIColor colorWithHex: 0xf9b600]
#define COLOR_BG_OPER               [UIColor colorWithHex: 0xf5cf15]
#define COLOR_TITLE_HIGH            [UIColor colorWithHex: 0xf5ab00]

#define COLOR_TITLE_A_ID            [UIColor colorWithHex: 0x333333]
#define COLOR_TEXT_BUTTON           [UIColor colorWithHex: 0x585858]

#define COLOR_TEXT_TIME             [UIColor colorWithHex: 0x929292]
#define COLOR_TEXT_MORE             [UIColor colorWithHex: 0x4c4c4c]

#define COLOR_TEXT_LIGHT            [UIColor colorWithHex: 0x989898]
#define COLOR_TEXT_LIGHTER          [UIColor colorWithHex: 0xdddddd]
#define COLOR_SEP                   [UIColor colorWithHex: 0xdddddd]

#define COLOR_9E9E9E                [UIColor colorWithHex: 0x9e9e9e]
#define COLOR_E4E4E4                [UIColor colorWithHex: 0xe4e4e4]
#define COLOR_282828                [UIColor colorWithHex: 0x282828]
#define COLOR_FFCC00                [UIColor colorWithHex: 0xffcc00]

#define COLOR_4A4A4A                [UIColor colorWithHex: 0x4a4a4a]
#define COLOR_838383                [UIColor colorWithHex: 0x838383]
#define COLOR_F4F4F4                [UIColor colorWithHex: 0xf4f4f4]
#define COLOR_4B4B4B                [UIColor colorWithHex: 0x4b4b4b4b]

#define COLOR_B5691C               [UIColor colorWithHex:0xB5691C]
#define COLOR_8A5629               [UIColor colorWithHex:0x8A5629]

#define COLOR_PROS_COLOR            [UIColor colorWithHex: 0xf94e49]
#define COLOR_CONS_COLOR            [UIColor colorWithHex: 0x238ff0]

#define COLOR_SEPARATOR             [UIColor colorWithHex: 0xe2e2e2]

#define COLOR_QA                    [UIColor colorWithHex: 0xB398FF]
#define COLOR_Link                  [UIColor colorWithHex: 0xFFA42D]
#define COLOR_Vote                  [UIColor colorWithHex: 0x28C38D]
#define COLOR_PK                    [UIColor colorWithHex: 0x28C38D]
#define COLOR_Topic                 [UIColor colorWithHex: 0x4070FA]
#define COLOR_Guess                 [UIColor colorWithHex: 0x81E9EB]
#define COLOR_Multi                 [UIColor colorWithHex: 0x4E54C8]

//145 225 245
#define COLOR_More                  _RGB(145,225,245, 1)

#define COLOR_Join                  [UIColor colorWithHex: 0x3F9CFE]

#define Color_Transparent_Black     _RGB_INT(6, 6, 6, .7)

#define _RGB(r,g,b, a)              [UIColor colorWithRed:r green:g blue:b alpha:a];
#define _RGB_INT(r,g,b, a)          [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]

//NS_ASSUME_NONNULL_BEGIN

UIColor *ColorWithString(NSString *hexString);
UIColor *ColorWithHex(NSInteger hex);
UIColor *ColorWithHexAplha(NSInteger hex, CGFloat alpha);
UIColor *ColorRandom(void);

@interface UIColor(add)

+ (UIColor*) colorWithHex:(NSInteger)hexValue alpha:(CGFloat)alphaValue;
+ (UIColor*) colorWithHex:(NSInteger)hexValue;
+ (NSString *) hexFromUIColor: (UIColor*) color;

+ (UIColor *)gradientFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor progress:(CGFloat)progress;

+ (UIColor *)colorFromString:(NSString *)hexString opacity:(CGFloat)opacity;

- (BOOL)isDark;

+ (UIColor *)colorFromString:(NSString *)string;

@end

//NS_ASSUME_NONNULL_END
